package com.houseman.workFlow.service.impl;

import java.util.List;

import com.houseman.workFlow.bean.ApprovalInfo;
import com.houseman.workFlow.dao.ApproveDao;
import com.houseman.workFlow.dao.impl.ApproveDaoImpl;
import com.houseman.workFlow.service.ApproveService;

public class ApproveServiceImpl implements ApproveService{

	ApproveDao dao = new ApproveDaoImpl();
	/**
	 * 创建流程审批信息
	 * @throws Exception
	 */
	public void saveApproveInfo(ApprovalInfo info) throws Exception {
		dao.saveApproveInfo(info);
	}
	
	/**
	 * 获取流程审批信息
	 * 审批时间排序(最新的在前)
	 * @param workId
	 * @return
	 * @throws Exception
	 */
	public List<ApprovalInfo> queryAppInfoByWorkId(int workId) throws Exception {
		return dao.queryAppInfoByWorkId(workId);
	}

	/**
	 * 获取最新流程审批信息
	 * @param workId
	 * @return
	 * @throws Exception
	 */
	public ApprovalInfo queryNewestByWorkId(int workId) throws Exception {
		return dao.queryNewestByWorkId(workId);
	}
}
